<style>
<!--

.eb-table-item
{
	float:left;
	clear:both;
	display:block;
	padding:5px;
	height:100px;
	width:100%;
	overflow:hidden;
	border:1px solid #C0C0C0;
	background-color:#FAFAFA;
	margin:10px 10px 0px 0px;
}
-->
</style>

<?php

	if (isset($folder))
	{
		$medias = EbModel::getModel('Media','Media')->selectByFolder($folder);
		$ref	= EbController::$request->url;
		
		foreach ($medias AS $media)
		{
			echo '<form id="media-form-'.$media->md_id.'" method="POST" action="/Media/EditMedia.do"><input type="hidden" name="md_id" value="'.$media->md_id.'" /><input type="hidden" name="ref" value="'.$ref.'" />';
			echo '<table class="eb-table-item"><tr><td style="width:110px;"><img src="'.$media->urlthumbnail.'"/></td>';
			echo '<td style="width:100%;"><input name="name" style="width:300px;" type="text" value="'.$media->name.'"/><br /><textarea style="width:300px;height:40px;" name="teaser">'.$media->teaser.'</textarea></td>';
			echo '<td align="right"><a class="minibutton" href="#" onclick="$(\'#media-form-'.$media->md_id.'\').submit();"><span class="edit">Modifier</span></a><br />';
			echo '<a class="minibutton" href="media/DeleteMedia.do?id='.$media->md_id.'" onclick="return confirm(\'Are you sure?\')"><span class="delete">Supprimer</span></a></td></tr></table></form>';
		}
	
		eb_widget('component',array('folder' => $folder,'module' => 'Media','file' => 'Uploader'));	
	}
	
?>